package org.rsbot.event.impl;

import org.rsbot.bot.Bot;
import org.rsbot.event.listeners.TextPaintListener;
import org.rsbot.script.methods.MethodContext;
import org.rsbot.script.wrappers.RSPlayer;
import org.rsbot.util.StringUtil;

import java.awt.*;

public class TAnimation implements TextPaintListener {
	private final MethodContext ctx;

	public TAnimation(final Bot bot) {
		ctx = bot.getMethodContext();
	}

	public int drawLine(final Graphics render, int idx) {
		final int[] a = { -1, -1 };
		if (ctx.game.isLoggedIn()) {
			final RSPlayer player = ctx.players.getMyPlayer();
			a[0] = player.getAnimation();
			a[1] = player.getPassiveAnimation();
		}
		StringUtil.drawLine(render, idx++, "Animation " + a[0]);
		StringUtil.drawLine(render, idx++, "Stance Animation " + a[1]);
		return idx;
	}
}
